﻿<!--#include file="const.asp"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%
if sid="Null" then
	Response.Redirect "login.asp"
	Response.end
end if
dim url,urls,fso,x,f,page,a,b,c,d,e,i,body
url=Request.QueryString("url")
urls=Replace(url,"@","&amp;")
    	Page = Request("page")      '当前页数
    	If Page = "" Then Page = 1
   	If Not IsNumeric(Page) Then Page = 1
    	Page = CLng(Page)
    	If Page < 1 Then Page = 1
SET Fso = CreateObject("Scripting.FileSystemObject")
Set X = Fso.GetFolder(Server.MapPath("../img"&Request.QueryString("Dir")))
%>
<card title="图片文件管理"><p align="left">
<a href='../photo/wenjian.asp?url=<%=url%>&amp;Dir=<%=Request.QueryString("Dir")%>&amp;tsid=<%=sid%>&amp;v=1&amp;fv=15'>上传图片</a><br/>
<%
if page=1 then
For Each F in X.Subfolders '遍历目录
%>
<a href='wenjian.asp?url=<%=url%>&amp;Dir=<%=Request.QueryString("Dir")%>/<%=F.Name%>&amp;sid=<%=sid%>'><%=F.Name%>/文件夹</a>[<a href='delwenjian.asp?url=<%=url%>&amp;act=1&amp;sid=<%=sid%>&amp;tp=../img<%=Request.QueryString("Dir")%>/<%=F.Name%>'>删除</a>]<br/>
<% 
Next
end if
For Each F in X.Files '遍历文件
body=body&F.Name&";" 
Next
body=Split(body,";")
a=(page-1)*14+1
b=page*14+1
c=ubound(body)
d=c mod 14
if d>0 then
e=c\14+1
else
e=c\14
end if
if page=e then
for i=a to c
F=body(i-1)
%>
<img src="../img<%=Request.QueryString("Dir")%>/<%=F%>" alt="<%=F%>" noselect = "true"/><br/>
<a href='<%=urls%>&amp;sid=<%=sid%>&amp;tp=/img<%=Request.QueryString("Dir")%>/<%=F%>'>选择</a>|<a href='delwenjian.asp?url=<%=url%>&amp;sid=<%=sid%>&amp;tp=../img<%=Request.QueryString("Dir")%>/<%=F%>'>删除</a><br/>
<%
Next
else
for i=a to b
F=body(i-1)
%>
<img src="../img<%=Request.QueryString("Dir")%>/<%=F%>" alt="<%=F%>" noselect = "true"/><br/>
<a href='<%=urls%>&amp;sid=<%=sid%>&amp;tp=/img<%=Request.QueryString("Dir")%>/<%=F%>'>选择</a>|<a href='delwenjian.asp?url=<%=url%>&amp;sid=<%=sid%>&amp;tp=../img<%=Request.QueryString("Dir")%>/<%=F%>'>删除</a><br/>
<%
Next
set fso=nothing
end if
    		If Page < e Then
    		    Response.Write("<a href='wenjian.asp?url="&url&"&amp;page=" & Page + 1 & "&amp;dir=" & Request.QueryString("Dir") & "&amp;sid=" & sid & "'>下一页</a>")
    		End If
       
    		If Page > 1 And Page < e Then
    		    Response.Write("|")
    		End If        
    		If Page > 1 Then
    		    Response.Write("<a href='wenjian.asp?url="&url&"&amp;page=" & Page - 1 & "&amp;dir=" & Request.QueryString("Dir") & "&amp;sid=" & sid & "'>上一页</a><br/>")
    		Elseif e >1 then
    		    Response.Write("<br/>")
    		End If
    		If e > 2 Then
    		    Response.Write("跳到第<input name='Page' format='*N' size='5' maxlength='5'/>")
    		    Response.Write("<anchor>页")
    		    Response.Write("<go href='wenjian.asp?url="&url&"&amp;dir=" & Request.QueryString("Dir") & "&amp;sid=" & sid & "' method='post'>")
    		    Response.Write("<postfield name='Page' value='$(Page:n)' />")
    		    Response.Write("</go></anchor><br/>")
    		End If
    		If e > 1 Then
    		Response.Write("(第" & Page & "页/总" & e & "页/共"&c&"条)<br/>")
    		End If

if Request.QueryString("Dir")<>"" then
%>
<a href='wenjian.asp?url=<%=url%>&amp;sid=<%=sid%>'>返回上级目录</a><br/>
<%
end if
%>
<a href='<%=urls%>&amp;sid=<%=sid%>'>返回上级管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
end Function
%>
 
